Skip to content

Conversation

@sureshanaparti
Copy link
Contributor

@sureshanaparti sureshanaparti commented Sep 3, 2025

Description

This PR enables backup framework when the config 'backup.framework.enabled' is set to true in Zone scope and not in Global setting. It checks backup framework enabled config is set to true or not in any of the zone scope setting when disabled in Global scope, thus supporting backup in a specific zone (and not entire cloud deployment).

Doc PR: apache/cloudstack-documentation#579

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

  • Enable 'backup.framework.enabled' config in global settings.
  • Restart management server, notice the backup APIs discovered and relevant sections shown in UI.

How did you try to break this feature and the system with this change?

@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@codecov
Copy link

codecov bot commented Sep 3, 2025

Codecov Report

❌ Patch coverage is 0% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 16.26%. Comparing base (b7fc717) to head (e036a51).

Files with missing lines Patch % Lines
...rg/apache/cloudstack/backup/BackupManagerImpl.java 0.00% 8 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.20   #11567   +/-   ##
=========================================
  Coverage     16.26%   16.26%           
  Complexity    13419    13419           
=========================================
  Files          5658     5658           
  Lines        499425   499425           
  Branches      60613    60612    -1     
=========================================
+ Hits          81232    81235    +3     
+ Misses       409143   409142    -1     
+ Partials       9050     9048    -2     
Flag Coverage Δ
uitests 4.03% <ø> (ø)
unittests 17.12% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@abh1sar abh1sar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove this at line 983. Otherwise backup apis won't show if backup framework is enabled at zone but disabled globally.

        if (!BackupFrameworkEnabled.value()) {
            return cmdList;
        }

@sureshanaparti sureshanaparti changed the title Check backup framework enabled config in zone scope first (before checking in global scope) [WIP] Check backup framework enabled config in zone scope first (before checking in global scope) Sep 4, 2025
@sureshanaparti sureshanaparti force-pushed the check-backup-framework-disable-in-zone branch from 2f0ee6d to b0b037f Compare September 9, 2025 10:35
@sureshanaparti sureshanaparti changed the title [WIP] Check backup framework enabled config in zone scope first (before checking in global scope) Update backup framework enabled config to global scope Sep 9, 2025
@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR moves the backup framework enabled configuration from zone-scoped to global-scoped, simplifying the backup management by removing per-zone enablement checks. The change affects how the backup framework determines if it's enabled, removing the need to check individual zones.

Key Changes

  • Removed zone-specific backup framework configuration support
  • Simplified backup enablement logic to use global configuration only
  • Updated error messages to reflect global scope

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
api/src/main/java/org/apache/cloudstack/backup/BackupManager.java Removes zone scope from backup framework configuration key
server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java Updates backup enablement checks to use global configuration and removes zone-specific logic

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@blueorangutan
Copy link

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 14918

@sureshanaparti sureshanaparti changed the title Update backup framework enabled config to global scope [WIP] Update backup framework enabled config to global scope Sep 10, 2025
@sureshanaparti sureshanaparti force-pushed the check-backup-framework-disable-in-zone branch 2 times, most recently from 233ce0d to 08aaaaf Compare September 24, 2025 07:09
@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15153

@sureshanaparti sureshanaparti force-pushed the check-backup-framework-disable-in-zone branch from 08aaaaf to 2dffcda Compare September 25, 2025 07:48
@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15163

@sureshanaparti sureshanaparti changed the title [WIP] Update backup framework enabled config to global scope Check backup framework enabled config in zone scope first (before checking in global scope) Sep 26, 2025
@sureshanaparti
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@sureshanaparti
Copy link
Contributor Author

@DaanHoogland No, ConfigKey.valueInScope(Scope, Long) fetches the value in that scope with id specified, if it doesn't exist, picks the global value.

reading the title of this PR that seems to be the intention?!?

updated title & description.

public List<Class<?>> getCommands() {
final List<Class<?>> cmdList = new ArrayList<Class<?>>();
if (!BackupFrameworkEnabled.value()) {
if (!BackupFrameworkEnabled.value() && !BackupFrameworkEnabled.hasValueInScope(Boolean.TRUE.toString())) {
Copy link
Contributor

@shwstppr shwstppr Oct 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not restrict/allow API access based on the zone config value. It might break UI/clients.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shwstppr it doesn't restrict API access. it allows API access if it is enabled in global or in any zone (not mandatory to enable in global scope). previously, enabling at global level is mandatory for API access.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sureshanaparti I understand that, but won't it create an issue in UI showing backup-related options for zones and for zone resources where backup feature is not enabled?
eg: assignVirtualMachineToBackupOffering action will start showing for all VMs, deploy VM form will start showing backup options even for zone where option isn't available.

Though, this could be currently true for the other way around as well

@weizhouapache weizhouapache modified the milestones: 4.20.2, 4.20.3 Oct 23, 2025
@DaanHoogland
Copy link
Contributor

@shwstppr @weizhouapache @abh1sar can you have another look, please?

Copy link
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine if others think APIs should be controlled with zone configs, but I don't find it consistent with the current auto-discovery behaviour of clients

public List<Class<?>> getCommands() {
final List<Class<?>> cmdList = new ArrayList<Class<?>>();
if (!BackupFrameworkEnabled.value()) {
if (!BackupFrameworkEnabled.value() && !BackupFrameworkEnabled.hasValueInScope(Boolean.TRUE.toString())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sureshanaparti I understand that, but won't it create an issue in UI showing backup-related options for zones and for zone resources where backup feature is not enabled?
eg: assignVirtualMachineToBackupOffering action will start showing for all VMs, deploy VM form will start showing backup options even for zone where option isn't available.

Though, this could be currently true for the other way around as well

@abh1sar
Copy link
Collaborator

abh1sar commented Dec 18, 2025

Sorry @sureshanaparti , I don't remember if it was discussed before. But what about making this config global scope only?
cc @shwstppr

@nvazquez
Copy link
Contributor

Hi @sureshanaparti @shwstppr are all the review comments addressed on this PR? If that is the case, is it ready for testing?

@shwstppr shwstppr self-requested a review January 27, 2026 04:34
@shwstppr
Copy link
Contributor

@nvazquez I don't have a strong opinion either way and others can chime in

@weizhouapache
Copy link
Member

if the new behavior applies on all the zone/global settings, and documented , I am ok with it

@abh1sar
Copy link
Collaborator

abh1sar commented Jan 28, 2026

I think it would be better to make this setting global.
It makes sense then that all the zones see backup related APIs in the UI.
Backup offerings are created per Zone by the Admin. So admin can just created backup offerings for the Zone where they want to.
Other zones will see the API Assign Backup Offering but there wouldn't be any offering to assign to.
Admins can still configure different providers for each zone.

With the solution of having per Zone setting and still showing backup APIs to other zones, there will be confusion and IMO it doesn't solve anything.

@sureshanaparti sureshanaparti force-pushed the check-backup-framework-disable-in-zone branch from 2dffcda to e036a51 Compare January 29, 2026 07:28
@sureshanaparti sureshanaparti changed the title Enable backup framework when the config 'backup.framework.enabled' is set to true in Zone scope and not in Global setting Update backup framework enabled config to global scope Jan 29, 2026
@sureshanaparti
Copy link
Contributor Author

I think it would be better to make this setting global. It makes sense then that all the zones see backup related APIs in the UI. Backup offerings are created per Zone by the Admin. So admin can just created backup offerings for the Zone where they want to. Other zones will see the API Assign Backup Offering but there wouldn't be any offering to assign to. Admins can still configure different providers for each zone.

With the solution of having per Zone setting and still showing backup APIs to other zones, there will be confusion and IMO it doesn't solve anything.

@abh1sar as discussed, backup config is updated to global setting again (reverted current changes). please check.

@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@abh1sar abh1sar self-assigned this Jan 29, 2026
@blueorangutan
Copy link

@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16610

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants